/*
 * Copyright (C) 2000-2008 Tan Menglong <TanMenglong@gmail.com>
 * 
 * This code is distributed under GNU Public License 2.0. Follow this URL for details.
 * http://www.opensource.org/licenses/gpl-license.phpl
 * 
 */

package net.ziqiang.sdk.ibatishelper.dao;

/*
 * iBatis generic methods interface
 * Auther: TanMenglong
 * Version: 0.003
 * Last modified: 20-Jan-08
 * Description: iBatis generic methods interface.
 */

import java.util.*;

/**
 * <p>
 * Generic iBatis methods interface.
 * </p>
 * @author Tan Menglong <a href="mailto:TanMenglong@gmail.com">TanMenglong@gmail.com</a>
 * @version 0.02
 */
public interface CommonDao {
	public <R> R get(String sqlType) throws RuntimeException;
	public <R,P> R getByParameter(P parameter,String sqlType) throws RuntimeException;

	public <R> List<R> getList(String sqlType) throws RuntimeException;
	public <R,P> List<R> getListByParameter(P parameter,String sqlType) throws RuntimeException;

	public boolean insert(String sqlType);
	public <P> boolean insertByParameter(P parameter,String sqlType);

	public <R> R insert2(String sqlType);
	public <R,P> R insertByParameter2(P parameter,String sqlType);
	
	public boolean update(String sqlType);
	public <P> boolean updateByParameter(P parameter,String sqlType);
	
	public boolean delete(String sqlType);
	public <P> boolean deleteByParameter(P parameter,String sqlType);
}
